import { observable, action } from 'mobx';
import { ReqListStore } from './reqListStore';
import { WeaTools } from 'ecCom';
import { isArray } from 'lodash';

export class WFListDoingStore extends ReqListStore{
    
    @observable showBatchSubmit = false;
    @observable showMyOrderBySet = false;
    @action
    updateShowMyOrberBySet =(bool = false)=> {
        this.showMyOrderBySet = bool;
    }
    /**
     * 是否显示二次验证的窗口
     */
    @observable
    showSecondAuth = false;

    @observable
    initSecondAuthDialog = false;

    //关注点击按钮的位置
    @observable clickPotion={};
    @observable followTypeSelectShow = false;
    @observable FollowRequestid='';
    constructor() {
        super();
        this.appendBaseParams({
            viewScope: "doing",
            complete: 0
        });
        const treeCache = WeaTools.ls.getJSONObj(`list${this.baseParams.viewScope}LeftTree`);
        this.leftTree = isArray(treeCache) ? treeCache : [];
        this.setShowBatchSubmit = this.setShowBatchSubmit.bind(this);
        this.setShowSecondAuth = this.setShowSecondAuth.bind(this);

        this.operBtnKey = 'batchSubmit';
    }
    @action
    setShowBatchSubmit(bool = false) {
        this.showBatchSubmit = bool;
    }

    @action
    setShowSecondAuth(bool = false) {
        this.showSecondAuth = bool;

        if (bool) {
            this.initSecondAuthDialog = true;
        }
    }

    @action
    setClickPotion(params) {
        this.clickPotion = params;
    }
}